package com.snack.shop.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

/**
 * 用户实体
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_user")
@Schema(description = "用户表")
public class User extends BaseEntity {

    @Schema(description = "微信openid")
    private String openid;

    @Schema(description = "手机号")
    private String phone;

    @Schema(description = "密码（MD5加密）")
    private String password;

    @Schema(description = "昵称")
    private String nickname;

    @Schema(description = "头像")
    private String avatar;

    @Schema(description = "性别：0-未知，1-男，2-女")
    private Integer gender;

    @Schema(description = "用户类型：1-普通用户，2-配送员，3-商家")
    @TableField("user_type")
    @JsonProperty("userType")
    private Integer userType;

    @Schema(description = "账户余额")
    private BigDecimal balance;

    @Schema(description = "状态：0-禁用，1-启用")
    private Integer status;
}

